<?php 
require ('model/model.php');
    	@$cmd = $_GET['cmd'];
        switch ($cmd) {    

            case 'SHOWNEWS';  
                    $page = $_GET['xPage'];
                    $limit = 2 ;
                    $total = get_listnews();
                    $total2 = ceil($total / $limit);
                    $news = get_2news($page);
                    require ('view/news.php');
            break;

            case 'GETLIENHE';
                    $lienhe =get_info("lienhe") ;
                    require ('view/lienhe.php');
            break;
        
            case 'GETQUIDINH';              
                    $quidinh =get_info("quydinh") ;  
                    require ('view/quidinh.php');
            break;
///////////////////////////////////////////////////////////////////////                
                
            
            case 'GETALLNEWS'; 
			    $news = get_listnews() ;
                require ('view/news.php');
			break; 

            case 'GETBYNEWSID'; 
                $id = $_REQUEST["idnews"]; 
			    $news = get_news($id) ;
                require ('view/news.php');
			break; 

            case 'GETBYID'; 
                $id = $_REQUEST["idmnu"]; 
			    $products = get_products($id) ;
                require ('view/products.php');
			break; 

            case 'GETALL';  
			    $products = get_allproducts() ;
                require ('view/products.php');
			break;   
			
            default:
				$mnusp = mnu_sanpham();
			    $listnews = get_listnews() ;
                require ('view/main.php');
            break;
}
?>